import { http } from "@/utils/http";
import type { HttpResult } from "@/utils/http/types";

export function queryTable(params: object) {
  return http.request<HttpResult>("get", "/admin/area/get/table", {
    params: params
  });
}

export function queryTreeTable(params: object) {
  return http.request<HttpResult>("get", "/admin/area/get/treetable", {
    params: params
  });
}

export function queryTree(params: object) {
  return http.request<HttpResult>("get", "/admin/area/get/tree", {
    params: params
  });
}

export function queryList(params: object) {
  return http.request<HttpResult>("get", "/admin/area/get/list", {
    params: params
  });
}

export function addObj(params: object) {
  return http.request<HttpResult>("post", "/admin/area/insert", {
    data: params
  });
}

export function updateObj(params: object) {
  return http.request<HttpResult>("post", "/admin/area/update", {
    data: params
  });
}

export function deleteObjs(ids: string) {
  return http.request<HttpResult>("post", `/admin/area/delete/${ids}`);
}
